#include "Logger.h"

QFile Logger::file("out.txt");
QTextStream Logger::out;

void Logger::open()
{
    if (!Logger::file.isOpen())
    {
        if (!Logger::file.open(QIODevice::WriteOnly | QIODevice::Text)) return;
        Logger::out.setDevice(&file);
    }
}
void Logger::write(QString message)
{
    Logger::out << message << endl;
    Logger::out.flush();
}
void Logger::close()
{
    Logger::file.close();
}
